<template>
    <div>
        {{ newData }}
        <button @click="fn">点击修改</button>
    </div>
</template>
<script>
export default {
    methods:{
        fn(){
            this.newData = "哈哈哈"
        }
    },
    computed:{//获取newData 
        newData:{//可以改成对象
            get(){
                //监听的是谁
                return this.data
            },
            set(value){
                this.data = value
            }
        }
    },
    data(){
        return{
            data:"我是私有数据"
        }
    }
}
</script>